/**
 * @author: sce
 * @description: 聊天记录
 */

import * as mongoose from 'mongoose';

const Schema = mongoose.Schema;

const ChatRecordSchem = new Schema({
    // 发送端用户ID
    send_user_id: {
        type: Schema.Types.ObjectId,
        required: true
    },
    // 接受端用户ID
    receive_user_id: {
        type: Schema.Types.ObjectId,
        required: true
    },
    // 消息种类，备用
    message_type: {
        type: Number
    },
    // 消息体
    message: {
        type: String,
        required: true
    },
    // 创建日期
    create_at: { type: Date, default: Date.now },
    // 更新日期
    update_at: { type: Date, default: Date.now }
});

mongoose.model('ChatRecord', ChatRecordSchem);